<template>
    <div style="height: 100%; width: 100%; position: relative">
        <div>
            <div class="pagetop" :class="!OtherShow ? 'all-top' : ''">
                <div class="top-row">
                    <span class="top-row-title">生成日期</span>
                    <span>
                        <el-date-picker v-model="searchParam.datetime1" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始日期" style="width: 160px"> </el-date-picker> 至
                        <el-date-picker v-model="searchParam.datetime2" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束日期" style="width: 160px"> </el-date-picker>
                    </span>
                    <span class="top-row-title">检验组</span>
                    <span style="width: 118px">
                        <rm-ddl-common :appendtobody="true" datatype="labgroup" v-model="searchParam.labgroupid" width="80" @change="labgroupChange"></rm-ddl-common>
                    </span>
                    <span class="top-row-title" style="width: 35px; text-align: right">科室</span>
                    <span style="width: 118px">
                        <el-select v-model="req_deptno" placeholder="" style="width:115px" @dblclick.native="popMultipleChk(req_deptno,'req_deptno',labdeptOption,'科室选择')" filterable clearable>
                            <el-option v-for="(item,index) in labdeptOption" :key="index" :value="item.data" :label="item.display"></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title" style="text-align: right">危急值分类</span>
                    <span style="width: 70px">
                        <el-select v-model="searchParam.alertkind" placeholder="请选择" style="width: 100%">
                            <el-option key="0" label="A类" value="A"></el-option>
                            <el-option key="1" label="B类" value="B"></el-option>
                            <el-option key="2" label="C类" value="C"></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title">医&nbsp;&nbsp;&nbsp; 院</span>
                    <span>
                        <rm-ddl-common datatype="hospital" dataname="医院" v-model="searchParam.hospcode" width="150px" @change="hospChange"></rm-ddl-common>
                    </span>
                    <span style="width: 80px; margin: 0 5px 0 18px">
                        <el-checkbox v-model="searchParam.nameflag" true-label="1" false-label="0"></el-checkbox> 剔除无姓名
                    </span>
                </div>
                <div class="top-row">
                    <span class="top-row-title">报告单元</span>
                    <span class="top-row-item2">
                        <el-select v-model="rptunitid" placeholder="" style="width:160px" @dblclick.native="popMultipleChk(rptunitid,'rptunitid',rptOption,'报告单元选择')" filterable clearable>
                            <el-option v-for="(item,index) in rptOption" :key="index" :value="item.data" :label="item.display"></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title">确认标志</span>
                    <span style="width: 102px">
                        <el-select v-model="searchParam.hischecktype" placeholder="请选择" @change="hischecktypeChange" style="width: 100%">
                            <el-option key="1" label="已确认" value="1"></el-option>
                            <el-option key="2" label="未确认" value="2"></el-option>
                            <el-option key="A" label="全部" value="A"></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title">处理标志</span>
                    <span style="width: 106px">
                        <el-select v-model="searchParam.hischecktype1" placeholder="请选择" @change="hischecktype1Change" style="width: 100%">
                            <el-option key="1" label="已处理" value="1"></el-option>
                            <el-option key="2" label="未处理" value="2"></el-option>
                            <el-option key="A" label="全部" value="A"></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title">有效标志</span>
                    <span style="width: 103px">
                        <el-select v-model="searchParam.validflag" placeholder="请选择" style="width: 100%">
                            <el-option key="1" label="有效" value="1"></el-option>
                            <el-option key="0" label="无效" value="0"></el-option>
                            <el-option key="9" label="召回" value="9"></el-option>
                            <el-option key="C" label="取消上报" value="C"></el-option>
                            <el-option key="" label="全部" value=""></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title" style="width: 30px; text-align: right">病区</span>
                    <span class="top-row-item">
                        <el-select v-model="req_wardno" placeholder="" style="width:103px" @dblclick.native="popMultipleChk(req_wardno,'req_wardno',wardOption,'病区选择')" filterable clearable>
                            <el-option v-for="(item,index) in wardOption" :key="index" :value="item.data" :label="item.display"></el-option>
                        </el-select>
                    </span>
                    <span class="top-row-title">病人ID</span>
                    <span>
                        <el-input v-model="searchParam.patid" style="width:150px" clearable></el-input>
                    </span>
                    <span style="width: 80px; margin: 0 5px 0 18px">
                        <el-checkbox v-model="searchParam.reqflag" true-label="1" false-label="0"></el-checkbox> 剔除无申请单
                    </span>
                </div>
                <div v-show="OtherShow">
                    <div class="top-row">
                        <span class="top-row-title">检验科室</span>
                        <span class="top-row-item2">
                            <rm-ddl-common datatype="labdept" dataname="检验科室" v-model="searchParam.labdeptval" width="100%" @change="labdeptChange"></rm-ddl-common>
                        </span>
                        <span class="top-row-title">确认耗时(分钟)</span>
                        <span class="top-row-item1 search-min">
                            <el-input size="small" style="width: 60px" v-model="searchParam.cp_hischkmin1" :disabled="cp_hischkState"></el-input> -
                            <el-input size="small" style="width: 60px" v-model="searchParam.cp_hischkmin2" :disabled="cp_hischkState"></el-input>
                        </span>
                        <span class="top-row-title">病人来源</span>
                        <span style="width: 103px">
                            <el-select v-model="searchParam.pat_typecode" placeholder="请选择" style="width: 100%" clearable>
                                <el-option v-for="(item, index) in patComeList" :key="index" :label="item.codena" :value="item.codeno"></el-option>
                            </el-select>
                        </span>
                        <span class="top-row-title">上报人</span>
                        <span class="top-row-item">
                            <el-select v-model="searchParam.alertmanno" placeholder="请选择上报人" style="width: 100%">
                                <el-option v-for="(item, index) in alertmanList" :key="index" :label="item.username" :value="item.userno">
                                    <span style="float: left">{{ item.userno }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.username }}</span>
                                </el-option>
                            </el-select>
                        </span>
                        <span style="width: 50px; margin: 0 5px 0 18px">
                            <el-checkbox v-model="searchParam.emer_flag" true-label="1" false-label="0"></el-checkbox> 加急
                        </span>

                    </div>
                    <div class="top-row">
                        <span class="top-row-title">上报类别</span>
                        <span class="top-row-item2">
                            <el-select v-model="searchParam.alerttype" placeholder="请选择" style="width: 100%">
                                <el-option key="0" label="危急值" value="0"></el-option>
                                <el-option key="1" label="多重耐药菌" value="1"></el-option>
                            </el-select>
                        </span>
                        <span class="top-row-title">处理耗时(分钟)</span>
                        <span class="top-row-item1 search-min">
                            <el-input size="small" style="width: 60px" v-model="searchParam.hischeckdt11" :disabled="hischeckdt1State"></el-input> -
                            <el-input size="small" style="width: 60px" v-model="searchParam.hischeckdt12" :disabled="hischeckdt1State"></el-input>
                        </span>
                        <span class="top-row-title">病历号</span>
                        <span class="top-row-item">
                            <el-input size="small" v-model="searchParam.pat_no" clearable></el-input>
                        </span>
                        <span class="top-row-title">上报耗时(分钟)</span>
                        <span class="top-row-item search-min">
                            <el-input size="small" style="width: 60px" v-model="searchParam.alertdt1"></el-input> -
                            <el-input size="small" style="width: 60px" v-model="searchParam.alertdt2"></el-input>
                        </span>
                    </div>
                    <div class="top-row">
                        <span class="top-row-title" style="width: 48px; text-align: right">姓名</span>
                        <span class="top-row-item2">
                            <el-input size="small" v-model="searchParam.pat_name" clearable></el-input>
                        </span>
                        <span class="top-row-title">内部耗时(分钟)</span>
                        <span class="top-row-item search-min">
                            <el-input size="small" style="width: 60px" v-model="searchParam.lis_transdt1"></el-input> -
                            <el-input size="small" style="width: 60px" v-model="searchParam.lis_transdt2"></el-input>
                        </span>
                        <span class="top-row-title" style="width: 180px; text-align: right">备注说明/取消上报原因</span>
                        <span style="width: 210px">
                            <el-input v-model="searchParam.descriptions" style="width: 100%"></el-input>
                        </span>
                    </div>
                </div>
                <div class="top-button">
                    <el-link :underline="false" @click="OtherShow = !OtherShow" style="margin-right: 10px">{{ OtherShow ? "收起▲" : "展开▼" }}</el-link>
                    <el-button icon="el-icon-search" v-has="'PINQUERY'" type="primary" @click="btn_queryEvent">查询</el-button>
                    <el-button icon="el-icon-printer" v-has="'PPRINT'" @click="printrecord">打印</el-button>
                    <el-button class="el-icon-edit-outline" v-has="'PPRINT'" @click="RptStyleSetting">打印样式设计</el-button>
                    <el-button icon="el-icon-upload2" v-has="'PEXPORT'" @click="exportExcel">导出</el-button>
                    <el-button v-has="'PEXPORT'" @click="setExportColumn">导出列设置</el-button>
                    <el-button icon="el-icon-delete" @click="btn_clearselEvent">清除</el-button>
                </div>
            </div>
            <div class="pagecenter" :class="!OtherShow ? 'all-center' : ''">
                <div class="middle-center" ref="xTableDiv" style="height: 100%">
                    <div style="height: 100%">
                        <vxe-table ref="xTable" :data="tableData" :context-menu="{ header: {disabled: false}}" :loading="loading" :keyboard-config="keyConfig" :keyboard-local-config="keyLocalConfig" :select-config="selectConfig" :sort-config="{ trigger: 'cell' }" border fit height="auto" header-align="center" resizable show-overflow="title" size="mini" stripe @current-change="currentChangeEvent" highlight-current-row>
                            <vxe-table-column :field="items.field" :title="items.title" :width="items.width" v-for="items in Cols" v-bind:key="items.field" align="center" header-align="center" :formatter="items.field == 'pat_sex' || items.field == 'alerttype' || items.field == 'validflag' || items.field == 'sendhisflag' ? format : null">
                                <template v-slot="{ row }" v-if="items.field == 'emer_flag'">
                                    <el-checkbox v-model="row.emer_flag" true-label="1" false-label="0"
										disabled></el-checkbox>
                                </template>
                                <template v-slot="{ row }" v-else-if="items.field == 'sendtelflag'">
                                    <el-checkbox v-model="row.sendtelflag" true-label="1" false-label="0"
										disabled></el-checkbox>
                                </template>
                                <template v-slot="{ row }" v-else-if="items.field == 'repeatflag'">
                                    <el-checkbox v-model="row.repeatflag" true-label="1" false-label="0"
										disabled></el-checkbox>
                                </template>
                                <template v-slot="{ row }" v-else>
                                    <div>{{ row[items.field] }}</div>
                                </template>
                            </vxe-table-column>
                        </vxe-table>
                    </div>
                </div>
            </div>
        </div>
        <el-dialog title="导出列选择" :visible.sync="chooseColumndialogVisible" width="380px" v-el-drag-dialog :close-on-click-modal="false">
            <rm-excolsetting :excolPro="excolPro" :allTableCol="allTableCol" @change="saveExportColumn"></rm-excolsetting>
        </el-dialog>
        <!--多选弹窗--->
        <el-dialog width="900px" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="multichktitle" :visible.sync="dialogMultipleVisible" :destroy-on-close="true">
            <rm-SqlMultiple :leftOption="option1" :rightOption="option2" :name="fieldname" @change="closedialog"></rm-SqlMultiple>
        </el-dialog>
        <rm-excolsetting :excolPro="excolPro" :allTableCol="allTableCol" @change="saveExportColumn" ref="excolset" v-show="false"></rm-excolsetting>
    </div>
</template>

<script>
import XEUtils from "xe-utils"; //引入工具类
import RmExcolsetting from "@/components/rmcompents/rm_excolsetting.vue";
export default {
    name: "LIS414",
    components: { RmExcolsetting },
    data() {
        return {
            searchParam: {
                // datetime1: "2017-03-01",XEUtils.toDateString(new Date(), "yyyy-MM-dd HH:mm")
                datetime1: XEUtils.toDateString(new Date(), "yyyy-MM-dd") + " 00:00:00",
                datetime2: XEUtils.toDateString(new Date(), "yyyy-MM-dd") + " 23:59:59",
                hischecktype: "A",
                hischecktype1: "A",
                validflag: "1",
                barcodeState: 0,
                timeState: 0,
                cp_hischkmin1: "0",
                cp_hischkmin2: "9999.00",
                hischeckdt11: "0",
                hischeckdt12: "9999.00",
                nameflag: "1",
                reqflag: "1",
                hospcode: "",
                patid: "",
            },
            OtherShow: false,
            rptunitid: "",
            patComeList: [], // 病人来源
            alertmanList: [], // 上报人
            tableData: [],
            loading: false,
            selrow: {},
            cp_hischkState: true,
            hischeckdt1State: true,
            selectConfig: {
                tigger: "row",
            },
            keyLocalConfig: {
                isArrow: true,
                isDel: true,
                isTab: true,
            },
            keyConfig: {
                isEdit: true,
            },
            chooseColumndialogVisible: false,
            excolPro: "lis414",
            allTableCol: [],
            labgroupname: "",
            hospname: "",
            labdeptname: "",
            dialogMultipleVisible: false,
            fieldname: "",
            option2: [],
            option1: [],
            multichktitle: "",

            req_deptno: "",
            labdeptOption: [],
            req_wardno: "",
            wardOption: [],
            rptOption: [],
            Cols: [],

        };
    },
    created() {
        this.ddlInitData(); //初始化下拉框的数据
    },
    mounted() {
        this.querypatComeList();
        this.queryalertManList();
		this.$refs.excolset.colSettingToDB();
    },
    watch: {},
    methods: {
        ddlInitData() {
            this.$tool
                .request({
                    url: "LIS/LIS4/LIS414",
                    method: "post",
                    data: {
                        action: "ddlInitData"
                    }
                })
                .then(res => {
                    this.labdeptOption = res.labdeptOption;
                    this.wardOption= res.wardOption;
                    this.rptOption= res.rptOption;
                    this.Cols = res.Cols;
                });
        },
        querypatComeList() {
            this.$tool
                .request({
                    url: "LIS/LIS4/LIS414",
                    method: "post",
                    data: {
                        action: "querypatcomelist",
                    },
                })
                .then((response) => {
                    if (response.Data != null && response.Data.length > 0) {
                        this.patComeList = response.Data;
                    }
                    this.searchParam.hospcode = response.defaulthospcode;
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        queryalertManList() {
            this.$tool
                .request({
                    url: "LIS/LIS4/LIS414",
                    method: "post",
                    data: {
                        action: "queryalertmanlist",
                    },
                })
                .then((response) => {
                    if (response.Data != null && response.Data.length > 0) {
                        this.alertmanList = response.Data;
                    }
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        btn_queryEvent() {
            this.$tool
                .request({
                    url: "LIS/LIS4/LIS414",
                    method: "post",
                    data: {
                        action: "querytable",
                        rptunitid: this.rptunitid,
                        req_deptno: this.req_deptno,
                        req_wardno: this.req_wardno,
                        ...this.searchParam,
                    },
                })
                .then((response) => {
                    if (response.errcode == "1") {
                        if (response.Data != null && response.Data.length > 0) {
                            this.tableData = response.Data;
                            for (let index = 0; index < this.tableData.length; index++) {
                                let element = this.tableData[index];
                                element.seq = index + 1;
                            }

                            this.$refs.xTable.setCurrentRow(response.Data[0]);
                        } else {
                            this.tableData = [];
                        }
                    } else {
                        return this.$message({
                            message: response.Data,
                            type: "warning",
                        });
                    }
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        popMultipleChk(e, fieldname, option, title) {
            let temp = XEUtils.clone(option, true);
            this.option1 = [];
            this.option2 = [];
            if (e != "") {
                let k = e.split(",");
                k.forEach(item => {
                    let ndata = temp.find(m => m.data == item);
                    if (ndata != undefined && ndata != null) {
                        this.option2.push(ndata);
                    }
                });
                temp.forEach(item => {
                    if (k.indexOf(item.data + "") < 0) {
                        this.option1.push(item);
                    }
                });
            } else {
                this.option1 = temp;
            }
            this.fieldname = fieldname;
            this.multichktitle = title;
            this.dialogMultipleVisible = true;
        },
        closedialog(value, name) {
            if (value != "close") {
                this[name] = value;
            }
            this.dialogMultipleVisible = false;
        },
        hischecktypeChange() {
            if (this.searchParam.hischecktype != "1") {
                this.cp_hischkState = true;
            } else {
                this.cp_hischkState = false;
            }
        },
        hischecktype1Change() {
            if (this.searchParam.hischecktype1 != "1") {
                this.hischeckdt1State = true;
            } else {
                this.hischeckdt1State = false;
            }
        },
        btn_clearselEvent() {
            this.searchParam = {
                datetime1: XEUtils.toDateString(new Date(), "yyyy-MM-dd"),
                datetime2: XEUtils.toDateString(new Date(), "yyyy-MM-dd"),
                hischecktype: "A",
                hischecktype1: "A",
                validflag: "1",
                barcodeState: 0,
                timeState: 0,
                cp_hischkmin1: "0",
                cp_hischkmin2: "9999.00",
                hischeckdt11: "0",
                hischeckdt12: "9999.00",
                // labdeptval: " ",
                // hospitalcode: " ",
                // labgroup: " ",
                emer_flag: 0,
            };
            this.req_deptno = "",
            this.req_wardno = "",
            this.rptunitid = "",
            this.cp_hischkState = true;
            this.hischeckdt1State = true;
            this.tableData = [];
            // console.log(this.searchParam)
        },
        currentChangeEvent() {
        },
        format({ cellValue, row, column }) {
            if (column.property == "pat_sex") {
                if (row.pat_sex == "All") {
                    return "所有";
                } else if (row.pat_sex == "1") {
                    return "男";
                } else {
                    return "女";
                }
            }
            if (column.property == "reqtype") {
                if (row.reqtype == "C") {
                    return "检验";
                } else if (row.reqtype == "H") {
                    return "输血";
                }
            } else if (column.property == "labprintflag") {
                if (row.labprintflag == 1) {
                    return "√";
                } else {
                    return "";
                }
            } else if (column.property == "alerttype") {
                if (row.alerttype == 0) {
                    return "危急值";
                } else if (row.alerttype == 1) {
                    return "多重耐药菌";
                } else {
                    return cellValue;
                }
            } else if (column.property == "sendhisflag") {
                if (row.sendhisflag == 1) {
                    return "等待发送";
                } else if (row.sendhisflag == 2) {
                    return "发送完成";
                } else if (row.sendhisflag == 3) {
                    return "发送失败";
                } else if (row.sendhisflag == 4) {
                    return "HIS已确认";
                } else if (row.sendhisflag == 5) {
                    return "召回失败";
                } else if (row.sendhisflag == 9) {
                    return "召回";
                } else {
                    return cellValue;
                }
            } else if (column.property == "validflag") {
                if (row.validflag == 1) {
                    return "有效";
                } else if (row.validflag == 0) {
                    return "无效";
                } else if (row.validflag == 9) {
                    return "召回";
                } else if (row.validflag == "C") {
                    return "取消上报";
                } else {
                    return cellValue;
                }
            } else {
                return cellValue;
            }
        },
        printrecord() {
            let printdata = this.$refs.xTable.afterFullData;
            if (printdata.length == 0) {
                this.$message.error("错误：没有要打印的数据！");
            } else {
                let column = this.$refs.xTable.getTableColumn().tableColumn;
                let str = JSON.stringify(this.$pub.InitColumn(column));
                str += "\r";
                str += JSON.stringify(printdata);
                let sql = btoa(encodeURIComponent(str));
                jsObj.PrintCustomJsonReport("5027", sql, this.$tool.getSession(this.$tool.loginuserno), "危急值上报", "");
            }
        },
        RptStyleSetting() {
            var data = this.$refs.xTable.tableData;
            if (data.length > 0) {
                const rload = this.$pub.openLoading(this, "正在打开报表设计器，请稍候……");
                let column = this.$refs.xTable.getTableColumn().tableColumn;
                let str = JSON.stringify(this.$pub.InitColumn(column));
                str += "\r";
                str += JSON.stringify(data);
                let sql = btoa(encodeURIComponent(str));
                jsObj.SetCustomJsonPrintConfig("5027", sql, this.$tool.getSession(this.$tool.loginuserno), "危急值上报样式");
                rload.close();
            } else {
                this.$message.error("错误：没有要打印的数据！");
            }
        },
        labgroupChange(code, name) {
            this.searchParam.labgroupid = code;
            this.labgroupname = name;
        },
        hospChange(code, name) {
            this.searchParam.hospcode = code;
            this.hospname = name;
        },
        labdeptChange(code, name) {
            this.searchParam.labdeptval = code;
            this.labdeptname = name;
        },
        exportExcel() {
            var rightlocalStorage = JSON.parse(window.localStorage.getItem(this.excolPro + "exportCol"));
            let tableColumn = this.$refs.xTable.getColumns();
            let exportColumn = [];
            if (rightlocalStorage && rightlocalStorage.length > 0) {
                rightlocalStorage.forEach((item) => {
                    exportColumn.push({
                        title: item.extitle ? item.extitle : item.title,
                        field: item.property,
                    });
                });
            } else {
                tableColumn.forEach((item) => {
                    exportColumn.push({ title: item.title, field: item.property });
                });
            }
            let filtertxt = this.getExportFilter();
            this.$pub.exportTableExcel(this.tableData, exportColumn, "LIS414 危急值上报查询.xlsx", filtertxt);
        },
        // 获取当前导出文件的所有查询条件
        getExportFilter() {
            let filtertxt = "生成日期:" + XEUtils.toDateString(this.searchParam.datetime1, "yyyy-MM-dd HH:mm:ss") + "至" + XEUtils.toDateString(this.searchParam.datetime2, "yyyy-MM-dd HH:mm:ss") + "; ";
            if(this.searchParam.labgroupid) filtertxt += "检验组:" + this.labgroupname + "; ";
            if(this.req_deptno)
            {
                let temp_req_deptno = "," + this.req_deptno + ",";
                let deptnoItems = this.labdeptOption.filter((item) => temp_req_deptno.indexOf(',' + item.data + ',') != -1);
                filtertxt += "科室:" + this.getOptionName(deptnoItems) + "; ";
            }
            if(this.searchParam.alertkind) filtertxt += "危急值分类:" + (this.searchParam.alertkind == "A" ? "A类" : this.searchParam.alertkind == "B" ? "B类" : "C类") + "; ";
            if(this.searchParam.hospcode) filtertxt += "医院:" + this.hospname + "; ";
            if(this.searchParam.nameflag == "1") filtertxt += "剔除无姓名; ";
            if(this.rptunitid)
            {
                let temp_rptunitid = "," + this.rptunitid + ",";
                let rptunitidItems = this.rptOption.filter((item) => temp_rptunitid.indexOf(',' + item.data + ',') != -1);
                filtertxt += "报告单元:" + this.getOptionName(rptunitidItems) + "; ";
            }
            filtertxt += "确认标志:" + (this.searchParam.hischecktype == "1" ? "已确认" : this.searchParam.hischecktype == "2" ? "未确认" : "全部") + "; ";
            filtertxt += "处理标志:" + (this.searchParam.hischecktype1 == "1" ? "已处理" : this.searchParam.hischecktype1 == "2" ? "未处理" : "全部") + "; ";
            filtertxt += "有效标志:" + this.getValidFlagName() + "; ";
            if(this.req_wardno)
            {
                let temp_req_wardno = "," + this.req_wardno + ",";
                let wardnoItems = this.wardOption.filter((item) => temp_req_wardno.indexOf(',' + item.data + ',') != -1);
                filtertxt += "病区:" + this.getOptionName(wardnoItems) + "; ";
            }
            if(this.searchParam.patid) filtertxt += "病人ID:" + this.searchParam.patid + "; ";
            if(this.searchParam.reqflag == "1") filtertxt += "剔除无申请单; ";
            if(this.searchParam.labdeptval) filtertxt += "检验科室:" + this.labdeptname + "; ";
            if(this.searchParam.cp_hischkmin1 || this.searchParam.cp_hischkmin2) filtertxt += "确认耗时(分钟):" + this.searchParam.cp_hischkmin1 + "至" + this.searchParam.cp_hischkmin2 + "; ";
            if(this.searchParam.pat_typecode) filtertxt += "病人来源:" + this.getOptionName(this.patComeList.filter((item) =>  this.searchParam.pat_typecode == item.codeno)) + "; ";
            if(this.searchParam.alertmanno) filtertxt += "上报人:" + this.getOptionName(this.alertmanList.filter((item) =>  this.searchParam.alertmanno == item.userno)) + "; ";
            if (this.searchParam.emer_flag) filtertxt += "加急; ";
            if (this.searchParam.alerttype) filtertxt += "上报类别:"+(this.searchParam.alerttype == "0" ? "危急值": "多重耐药菌") +"; ";
            if(this.searchParam.hischeckdt11 || this.searchParam.hischeckdt12) filtertxt += "处理耗时(分钟):" + this.searchParam.hischeckdt11 + "至" + this.searchParam.hischeckdt12 + "; ";
            if(this.searchParam.pat_no) filtertxt += "病历号:" + this.searchParam.pat_no + "; ";
            if(this.searchParam.alertdt1 || this.searchParam.alertdt2) filtertxt += "上报耗时(分钟):" + this.searchParam.alertdt1 + "至" + this.searchParam.alertdt2 + "; ";
            if(this.searchParam.pat_name) filtertxt += "姓名:" + this.searchParam.pat_name + "; ";
            if(this.searchParam.lis_transdt1 || this.searchParam.lis_transdt2) filtertxt += "内部耗时(分钟):" + this.searchParam.lis_transdt1 + "至" + this.searchParam.lis_transdt2 + "; ";
            if(this.searchParam.descriptions) filtertxt += "备注说明/取消上报原因:" + this.searchParam.descriptions + "; ";
            return filtertxt;
        },
        getValidFlagName() {
            let name = "";
            switch(this.searchParam.validflag) {
                case "1":
                    name = "有效";
                    break;
                case "0":
                    name = "无效";
                    break;
                case "9":
                    name = "召回";
                    break;
                case "C":
                    name = "取消上报";
                    break;
                default:
                    name = "全部";
                    break;
            }
            return name;
        },
        getOptionName(option) {
            if (option && option.length > 0) {
                let optionname = "";
                option.forEach((item) => {
                    if(item.hasOwnProperty("username")) {
                        optionname += item.username + ",";
                    } else if(item.hasOwnProperty("codena")) {
                        optionname += item.codena + ",";
                    } else if (item.hasOwnProperty("display")) {
                        optionname += item.display + ",";
                    } else {
                        optionname += item.label + ",";
                    }
                });
                return optionname.substring(0, optionname.length - 1);
            } else {
                return "";
            }
        },
        setExportColumn() {
            let allColumnList = [];
            let allTableCol = this.$refs.xTable.getTableColumn().tableColumn;
            allTableCol.forEach((element) => {
                if (element.property) {
                    allColumnList.push({
                        title: element.title,
                        property: element.property,
                    });
                }
            });
            this.allTableCol = allColumnList;
            this.chooseColumndialogVisible = true;
        },
        saveExportColumn() {
            this.chooseColumndialogVisible = false;
        },
    },
};
</script>

<style scoped>
table {
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 5px;
    width: 100%;
}
.all-top {
    height: 98px !important;
}
.all-center {
    top: 103px !important;
}
.pagetop {
    left: 0;
    right: 0;
    height: 192px;
    /* display: -webkit-box; */
    -webkit-box-pack: center;
    -webkit-box-align: center;
    border: solid 1px #ccc;
    position: absolute;
    z-index: 99;
    overflow-x: auto;
    overflow-x: overlay;
    white-space: nowrap;
}
::-webkit-scrollbar {
    width: 0px;
    height: 5px;
    border: 4px solid white;
}
::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
}
::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}
::v-deep .pagetop .el-input__icon {
    width: 16px !important;
}
::v-deep .pagetop .el-input--prefix .el-input__inner {
    padding-left: 22px !important;
}
::v-deep .pagetop .el-input--suffix .el-input__inner {
    padding-right: 22px !important;
}
::v-deep .search-min .el-input--small .el-input__inner {
    text-align: right !important;
}
.top-row {
    display: block;
    width: 100%;
    font-size: 12px;
    margin-top: 5px;
}
.top-row span {
    display: inline-block;
}
.top-row-title {
    margin: 0 5px;
}
.top-row-item {
    width: 100px;
}
.top-row-item1 {
    width: 130px;
}
.top-row-item2 {
    width: 179px;
}
.top-button {
    text-align: right;
    padding: 5px 5px 0 5px;
}

.pagecenter {
    position: absolute;
    top: 197px;
    width: 100%;
    left: 0;
    bottom: 0px;
    overflow: auto;
}
::v-deep .use-flag .el-radio {
    margin-right: 5px !important;
}
::v-deep .pagecenter .vxe-table .vxe-header--column {
    line-height: 15px !important;
}

::v-deep .pagecenter .el-checkbox__inner::after {
    border-color: #000000 !important;
}
</style>